#include<iostream>

#include"Server.hpp"
#include"Http.hpp"

int main(int argn,char* argv[])
{
    if(2!=argn)
    {
        printf("Usage error:%s\nUsage: %s port\n",argv[0],argv[0]);
        exit(-1);
    }
    Http::HttpServer httpserver;
    Server server(htons(std::stoi(argv[1])),std::bind(&Http::HttpServer::ServerHandler,&httpserver,std::placeholders::_1));
    server.Start();

    return 0;
}